commonlibsse_ng\re\m/
MagicItem.rs1use crate::re::Actor::Actor;
2use crate::re::ActorValues::{ActorValue, ActorValue_CEnum};
3use crate::re::BGSKeywordForm::{BGSKeywordForm, BGSKeywordFormVtbl};
4use crate::re::BSTArray::BSTArray;
5use crate::re::BSTSmartPointer::BSTSmartPointer;
6use crate::re::TESBoundObject::{TESBoundObject, TESBoundObjectVtbl};
7use crate::re::TESFile::TESFile;
8use crate::re::TESFullName::TESFullName;
9use crate::re::TESModel::TESModel;
10use crate::re::TESObjectWEAP::TESObjectWEAP;
11use crate::re::offsets_rtti::RTTI_MagicItem;
12use crate::re::offsets_vtable::VTABLE_MagicItem;
13use crate::re::{EffectItem, EffectSetting};
14use crate::re::{MagicSystem, QueuedFile};
15use crate::rel::id::VariantID;
16
17#[repr(C)]
18#[derive(Debug)]
19pub struct MagicItem {
20    pub __base: TESBoundObject,                   pub __base1: TESFullName,                     pub __base2: BGSKeywordForm,                  pub effects: BSTArray<*mut EffectItem>,       pub hostileCount: i32,                        pub pad74: u32,                               pub avEffect: *mut EffectSetting,             pub preloadCount: u32,                        pub pad84: u32,                               pub preloadItem: BSTSmartPointer<QueuedFile>, }
31const _: () = assert!(core::mem::size_of::<MagicItem>() == 0x90);
32
33impl MagicItem {
34    pub const RTTI: VariantID = RTTI_MagicItem;
35    pub const VTABLE: [VariantID; 3] = VTABLE_MagicItem;
36}
37
38#[repr(C)]
39pub struct MagicItemVtbl {
40    pub __base: TESBoundObjectVtbl,
42    pub __base1: BGSKeywordFormVtbl,
43
44    pub GetSpellType: extern "C" fn(this: *const MagicItem) -> MagicSystem::SpellType, pub SetCastingType: extern "C" fn(this: *mut MagicItem, ty: MagicSystem::CastingType), pub GetCastingType: extern "C" fn(this: *const MagicItem) -> MagicSystem::CastingType_CEnum, pub SetDelivery: extern "C" fn(this: *mut MagicItem, delivery: MagicSystem::Delivery), pub GetDelivery: extern "C" fn(this: *const MagicItem) -> MagicSystem::Delivery_CEnum, pub IsValidDelivery:
51        extern "C" fn(this: *const MagicItem, delivery: MagicSystem::Delivery) -> bool, pub GetFixedCastDuration: extern "C" fn(this: *const MagicItem) -> f32, pub GetRange: extern "C" fn(this: *const MagicItem) -> f32, pub IgnoresResistance: extern "C" fn(this: *const MagicItem) -> bool, pub IgnoreLOS: extern "C" fn(this: *const MagicItem) -> bool, pub IsFood: extern "C" fn(this: *const MagicItem) -> bool,    pub GetNoAbsorb: extern "C" fn(this: *const MagicItem) -> bool, pub GetNoDualCastModifications: extern "C" fn(this: *const MagicItem) -> bool, pub GetSkillUsageData: extern "C" fn(this: *const MagicItem, data: *mut SkillUsageData) -> bool, pub IsPoison: extern "C" fn(this: *const MagicItem) -> bool, pub IsMedicine: extern "C" fn(this: *const MagicItem) -> bool, pub AdjustCost: extern "C" fn(this: *const MagicItem, cost: *mut f32, actor: *mut Actor), pub GetChargeTime: extern "C" fn(this: *const MagicItem) -> f32, pub GetMaxEffectCount: extern "C" fn(this: *const MagicItem) -> u32, pub GetAssociatedSkill: extern "C" fn(this: *const MagicItem) -> ActorValue_CEnum, pub IsTwoHanded: extern "C" fn(this: *const MagicItem) -> bool, pub GetChunkID: extern "C" fn(this: *mut MagicItem) -> u32,     pub CopyMagicItemData: extern "C" fn(this: *mut MagicItem, src: *const MagicItem), pub LoadMagicItemChunk:
70        extern "C" fn(this: *mut MagicItem, mod_file: *mut TESFile, chunk_id: u32), pub LoadChunkDataPostProcess: extern "C" fn(this: *mut MagicItem, mod_file: *mut TESFile), pub GetData1: extern "C" fn(this: *const MagicItem) -> *const Data, pub GetData2: extern "C" fn(this: *mut MagicItem) -> *mut Data,     pub GetDataSize: extern "C" fn(this: *const MagicItem) -> u32,      pub InitFromChunk: extern "C" fn(this: *mut MagicItem, mod_file: *mut TESFile), pub InitChunk: extern "C" fn(this: *mut MagicItem),                 }
78const _: () = {
79    const VTABLE_SIZE: usize = core::mem::size_of::<MagicItemVtbl>();
80    const EXPECTED_SIZE: usize = 0x71 * core::mem::size_of::<usize>();
81    };
83
84#[repr(C)]
85#[derive(Debug)]
86pub struct PreloadableVisitor {
87    vtable: *const PreloadableVisitorVtbl,
88}
89const _: () = assert!(core::mem::size_of::<PreloadableVisitor>() == 0x08);
90
91#[repr(C)]
92pub struct PreloadableVisitorVtbl {
93    pub VisitModel: extern "C" fn(this: *mut PreloadableVisitor, model: *mut TESModel),
94    pub VisitWeapon: extern "C" fn(this: *mut PreloadableVisitor, weapon: *mut TESObjectWEAP),
95}
96
97#[repr(C)]
98#[derive(Debug)]
99pub struct SkillUsageData {
100    effect: *mut EffectItem, skill: ActorValue,       magnitude: f32,          custom: bool,            pad11: u8,               pad12: u16,              pad14: u32,              }
108const _: () = assert!(core::mem::size_of::<SkillUsageData>() == 0x18);
109
110#[repr(C)]
111#[derive(Debug)]
112pub struct Data {
113    costOverride: i32, flags: u32,        }
116const _: () = assert!(core::mem::size_of::<Data>() == 0x8);